import("//llvm/utils/TableGen/tablegen.gni")

tablegen("NVPTXGenAsmWriter") {
  visibility = [ ":MCTargetDesc" ]
  args = [ "-gen-asm-writer" ]
  td_file = "../NVPTX.td"
}

tablegen("NVPTXGenInstrInfo") {
  visibility = [ ":MCTargetDesc" ]
  args = [ "-gen-instr-info" ]
  td_file = "../NVPTX.td"
}

tablegen("NVPTXGenRegisterInfo") {
  visibility = [ ":MCTargetDesc" ]
  args = [ "-gen-register-info" ]
  td_file = "../NVPTX.td"
}

tablegen("NVPTXGenSubtargetInfo") {
  visibility = [ ":MCTargetDesc" ]
  args = [ "-gen-subtarget" ]
  td_file = "../NVPTX.td"
}

static_library("MCTargetDesc") {
  output_name = "LLVMNVPTXDesc"

  # This should contain tablegen targets generating .inc files included
  # by other targets. .inc files only used by .cpp files in this directory
  # should be in deps on the static_library instead.
  public_deps = [
    ":NVPTXGenInstrInfo",
    ":NVPTXGenRegisterInfo",
    ":NVPTXGenSubtargetInfo",
  ]
  deps = [
    ":NVPTXGenAsmWriter",
    "//llvm/lib/MC",
    "//llvm/lib/Support",
    "//llvm/lib/Target/NVPTX/TargetInfo",
    "//llvm/lib/TargetParser",
  ]
  include_dirs = [ ".." ]
  sources = [
    "NVPTXInstPrinter.cpp",
    "NVPTXMCAsmInfo.cpp",
    "NVPTXMCTargetDesc.cpp",
    "NVPTXTargetStreamer.cpp",
  ]
}
